package com.handz.test.config;

import org.apache.shiro.mgt.SecurityManager;
import org.apache.shiro.spring.web.ShiroFilterFactoryBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.servlet.Filter;
import java.util.LinkedHashMap;
import java.util.Map;

/**
 * 应用模块名称<p>
 *
 * @author hepeiyun
 * @since 2019/11/5
 */
@Configuration
public class ShiroConfig {


    @Bean
    public ShiroFilterFactoryBean shiroFilter(SecurityManager securityManager) {
        ShiroFilterFactoryBean shiroFilterFactoryBean = new ShiroFilterFactoryBean();
        shiroFilterFactoryBean.setSecurityManager(securityManager);
        //配置登录页面
        shiroFilterFactoryBean.setLoginUrl("/login");
        //配置登陆成功页面
        shiroFilterFactoryBean.setSuccessUrl("/index");
        Map<String, Filter> filterMap = new LinkedHashMap<>();
        //.put("kickout",)
        return shiroFilterFactoryBean;
    }


}
